package com.cy.member;

import java.awt.Dimension;
import java.awt.Point;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class Hint extends JLabel {
	private static final long serialVersionUID = 1L;
	//hint的坐标，不是像素点
	private Point site;
	//hint的尺寸
	private static Dimension dimension = new Dimension(51,47);
	
	public Hint(ImageIcon image) {
		super(image);
	}

	/**
	 * 获取hint的坐标
	 * @return
	 */
	public Point getSite() {
		return site;
	}

	/**
	 * 设置hint的坐标
	 * @param site
	 */
	public void setSite(Point site) {
		this.site = site;
		Point p = Chessboard.sites[site.x][site.y];
		this.setBounds(p.x - dimension.width/2, p.y - dimension.height/2, dimension.width, dimension.height);
	}
	
	
}
